package com.cnc.ssm.web;

import com.cnc.bas.util.Constants;
import com.cnc.bas.util.LTUtil;
import com.cnc.bas.web.BasMapForm;
import com.cnc.bas.web.SecureBaseDispatchAction;
import com.cnc.ssm.ISsmService;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;

/**
 * User: Du bf
 * Date: 2005-3-24
 */

public class LoginLogAction extends SecureBaseDispatchAction {
    private ISsmService ssmService = null;

    public void setServlet(ActionServlet actionServlet) {
        super.setServlet(actionServlet);
        ssmService = (ISsmService) this.getBean(Constants.BEAN_NAME_SSM);
    }

    public ActionForward list(ActionMapping mapping,
                              ActionForm form,
                              HttpServletRequest request,
                              HttpServletResponse response) throws Exception {
        HashMap hs = ((BasMapForm) form).getHs();
        LTUtil.addHsLike(hs, "operCode,operName,loginAddr");
        List list = ssmService.listLoginLog(hs);
        LTUtil.setPageData(request, list);
        return mapping.findForward("list");
    }
}
